<?php $__env->startSection('extra_css'); ?>
    <?php if($settings_general->site_post_as_titles == 1): ?>
        <title><?php echo e($post->title); ?></title>
    <?php else: ?>
        <title><?php echo e($settings_general->site_title); ?></title>
    <?php endif; ?>

    <?php if(sizeof($post->tags) > 0): ?>
        <meta name="keywords" content="<?php echo e(implode(',',$post->tags->lists('title')->toArray())); ?>">
    <?php endif; ?>

    <meta name="description" content="<?php echo e(\Illuminate\Support\Str::limit(trim(strip_tags($post->description)),300)); ?>">

    <!--Twitter Card-->
    <meta property="twitter:card" content="summary"/>
    <meta property="twitter:site" content="<?php echo e($settings_social->twitter_handle); ?>"/>
    <meta property="twitter:title" content="<?php echo e($post->title); ?>"/>
    <meta property="twitter:description" content="<?php echo e(\Illuminate\Support\Str::limit(trim(strip_tags($post->description)),300)); ?>"/>
    <meta property="twitter:image" content="<?php echo e($post->featured_image); ?>"/>
    <meta name="twitter:creator" content="<?php echo e($settings_social->twitter_handle); ?>">
    <meta property="twitter:url" content="<?php echo e(URL::to($post->slug)); ?>"/>

    <!--Og tags-->
    <meta property="og:site_name" content="<?php echo e($settings_general->site_title); ?>"/>
    <meta property="og:title" content="<?php echo e($post->title); ?>"/>
    <meta property="og:description" content="<?php echo e(\Illuminate\Support\Str::limit(trim(strip_tags($post->description)),300)); ?>"/>
    <meta property="og:type" content="article"/>
    <meta property="og:url" content="<?php echo e(URL::to($post->slug)); ?>"/>
    <meta property="og:image" content="<?php echo e($post->featured_image); ?>"/>

    <?php foreach($related_posts as $r): ?>
        <meta property="og:see_also" content="<?php echo e(URL::to($r->slug)); ?>"/>
    <?php endforeach; ?>

    <meta property="article:published_time" content="<?php echo e($post->created_at); ?>"/>
    <meta property="article:modified_time" content="<?php echo e($post->updated_at); ?>"/>

    <?php foreach($post->tags as $tag): ?>
        <meta property="article:tag" content="<?php echo e($tag->title); ?>"/>
    <?php endforeach; ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('extra_js'); ?>
    <?php if(strlen($settings_social->addthis_js) > 0 && $settings_social->show_sharing == 1): ?>
        <?php echo $settings_social->addthis_js; ?>

    <?php endif; ?>

    <?php if(strlen($settings_social->sharethis_js) > 0 && $settings_social->show_sharing == 1): ?>
        <?php echo $settings_social->sharethis_js; ?>

    <?php endif; ?>

    <?php if($settings_comments->comment_system == \App\Posts::COMMENT_FACEBOOK): ?>
        <?php echo $settings_comments->fb_js; ?>

    <?php endif; ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <?php if($post->image_parallax == 1 && $post->render_type == \App\Posts::RENDER_TYPE_IMAGE): ?>
        <div class="parallax-header">

            <!-- Parallax image -->
            <div class="parallax-image" id="parallax-image" data-stellar-ratio="0.5"
                 data-image="<?php echo e($post->featured_image); ?>"></div>

            <!-- Post title and meta -->
            <div class="parallax-wrapper">
                <div class="container">
                    <div class="mag-content parallax-box">
                        <div class="row">
                            <div class="col-md-12 parallax-box">
                                <?php echo $__env->make('layouts.post_header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            </div>
                            <!-- .col-md-12 -->
                        </div>
                        <!-- .row -->
                    </div>
                </div>
                <!-- .container -->

            </div>
            <!-- .parallax-wrapper -->
        </div>
    <?php endif; ?>

    <div class="container main-wrapper">

        <?php if(!empty($ads[\App\Ads::TYPE_ABOVE_POST])): ?>
            <div class="mag-content clearfix">
                <div class="row">
                    <div class="col-md-12">
                        <div class="ad728-wrapper">

                            <?php echo $ads[\App\Ads::TYPE_ABOVE_POST]->code; ?>


                        </div>
                    </div>
                </div>
            </div>
        <?php endif; ?>


        <div class="main-content mag-content clearfix">

            <div class="row blog-content">

                <div class="col-md-8">

                    <?php echo $__env->make('admin.layouts.notify', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

                    <article class="post-wrapper clearfix">

                        <?php if($post->render_type == \App\Posts::RENDER_TYPE_IMAGE): ?>
                            <?php echo $__env->make('layouts.post_header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <?php endif; ?>

                        <?php if($post->render_type == \App\Posts::RENDER_TYPE_GALLERY): ?>
                            <?php echo $__env->make('layouts.post_header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <?php endif; ?>

                        <?php if($post->render_type == \App\Posts::RENDER_TYPE_VIDEO): ?>
                            <?php echo $__env->make('layouts.post_header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <?php endif; ?>

                        <?php if($post->render_type == \App\Posts::RENDER_TYPE_TEXT): ?>
                            <?php echo $__env->make('layouts.post_header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <?php endif; ?>

                        <?php if($post->rating_box == 1): ?>
                            <div class="post-review-wrapper clearfix">
                                <div class="post-review-summary clearfix">
                                    <div class="post-review-sum-point">
                                        <h4 id="rate_target"><?php echo e(\App\Libraries\Utils::doubleTruncate($post->average_rating,1)); ?></h4>
                   <span class="article_raty"
                         data-score="<?php echo e(\App\Libraries\Utils::doubleTruncate($post->average_rating,1)); ?>"></span>

                                        <p style="text-align: center;">
                                            <small>(<?php echo e($post->rating_count); ?>) Reviews</small>
                                        </p>

                                        <p>
                                            <button type="button" class="btn btn-primary" data-toggle="modal"
                                                    data-target="#rate_me">
                                                Rate Now
                                            </button>
                                        </p>

                                    </div>
                                    <div class="post-review-description">
                                        <div class="post-content clearfix"><?php echo $post->description; ?></div>
                                    </div>
                                </div>

                            </div>
                        <?php else: ?>
                            <div class="post-content clearfix"><?php echo $post->description; ?></div>
                        <?php endif; ?>

                        <?php if($post->type == \App\Posts::TYPE_SOURCE): ?>
                            <a href="<?php echo e($post->link); ?>" type="button" class="pull-right btn btn-success btn-lg">Read
                                more</a>
                        <?php endif; ?>


                        <?php if($post->rating_box == 1): ?>
                            <div class="modal fade" id="rate_me" tabindex="-1" role="dialog"
                                 aria-labelledby="review-modalLabel" aria-hidden="true">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal"
                                                    aria-hidden="true">&times;</button>
                                            <h4 class="modal-title" id="review-modalLabel">Rate this article:</h4>
                                        </div>
                                        <div class="modal-body">

                                            <form action="/submit_rating" method="POST">

                                                <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>"/>
                                                <input type="hidden" name="id" value="<?php echo e($post->id); ?>"/>

                                                <div class="form-group form-group-rating">
                                                    <div class="rating-label">
                                                        <p><strong>How do you rate this article ?</strong></p>
                                                    </div>
                                                    <div class="clearfix"></div>
                                                    <div id="ratyRating"></div>
                                                    <div class="clearfix"></div>
                                                </div>

                                                <div class="form-group">
                                                    <label for="rate_name">Please enter your name</label>
                                                    <input class="form-control" name="name" id="rate_name"/>
                                                </div>

                                                <div class="form-group">
                                                    <label for="rate_email">Please enter your email</label>
                                                    <input class="form-control" name="email" id="rate_email"/>
                                                </div>

                                                <div class="review-actions">
                                                    <button type="submit" class="btn btn-success"><strong>Submit
                                                            Rating</strong></button>
                                                </div>

                                            </form>


                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endif; ?>

                        <footer class="post-meta">
                            <div class="tags-wrapper">
                                <ul class="tags-widget clearfix">
                                    <li class="trending">TAGS:</li>
                                    <?php foreach($post->tags as $tag): ?>
                                        <li><a href="/tag/<?php echo e($tag->slug); ?>"><?php echo e($tag->title); ?></a></li>
                                    <?php endforeach; ?>
                                </ul>
                            </div>
                            <!-- .tags-wrapper -->

                            <div class="share-wrapper clearfix">
                                <?php if(strlen($settings_social->addthis_js) > 0 && $settings_social->show_sharing == 1): ?>
                                    <div class="addthis_sharing_toolbox"></div>
                                <?php endif; ?>

                                <?php if(strlen($settings_social->sharethis_span_tags) > 0 && strlen($settings_social->sharethis_js) > 0 && $settings_social->show_sharing == 1): ?>
                                    <?php echo $settings_social->sharethis_span_tags; ?>

                                <?php endif; ?>
                            </div>

                            <div class="row">
                                <div class="post-nav-wrapper clearfix">
                                    <div class="col-md-6 omega">
                                        <div class="previous-post">
                                            <div class="post-nav-label">
                                                <i class="fa fa-angle-left"></i>
                                                Previous post
                                            </div>
                                            <?php if(!empty($post->prev)): ?>
                                                <a href="/<?php echo e($post->prev->slug); ?>"
                                                   class="post-nav-title"><?php echo e($post->prev->title); ?></a>
                                            <?php endif; ?>
                                        </div>
                                    </div>

                                    <div class="col-md-6 alpha">
                                        <div class="next-post">
                                            <div class="post-nav-label">
                                                Next post
                                                <i class="fa fa-angle-right"></i>
                                            </div>
                                            <?php if(!empty($post->next)): ?>
                                                <a href="/<?php echo e($post->next->slug); ?>"
                                                   class="post-nav-title"><?php echo e($post->next->title); ?></a>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </div>
                                <!-- .post-nav-wrapper -->
                            </div>

                            <?php if($post->show_author_box == 1): ?>
                                <div class="author-box clearfix">
                                    <div class="author-avatar">
                                        <a href="/author/<?php echo e($post->author->slug); ?>">
                                            <img alt="" src="<?php echo e($post->author->avatar); ?>" class="avatar"
                                                 height="110"
                                                 width="110">
                                        </a>
                                    </div>
                                    <div class="author-info">
                                        <h3><a href="/author/<?php echo e($post->author->slug); ?>"><?php echo e($post->author->name); ?></a></h3>

                                        <p class="author-bio">
                                            <?php echo e($post->author->bio); ?>

                                        </p>

                                        <?php if($post->show_author_socials == 1): ?>
                                            <div class="author-contact">
                                                <?php if(strlen($post->author->email)>0): ?>
                                                    <a href="mailto:<?php echo e($post->author->email); ?>"><i
                                                                class="fa fa-envelope fa-lg"
                                                                title="Email"></i></a>
                                                <?php endif; ?>
                                                <?php if(strlen($post->author->website_url)>0): ?>
                                                    <a href="<?php echo e($post->author->website_url); ?>" target="_blank"><i
                                                                class="fa fa-globe fa-lg"
                                                                title="Website"></i></a>
                                                <?php endif; ?>

                                                <?php if(strlen($post->author->fb_url)>0): ?>
                                                    <a href="<?php echo e($post->author->fb_url); ?>" target="_blank"><i
                                                                class="fa fa-facebook fa-lg"
                                                                title="Facebook"></i></a>
                                                <?php endif; ?>

                                                <?php if(strlen($post->author->twitter_url)>0): ?>
                                                    <a href="<?php echo e($post->author->twitter_url); ?>" target="_blank"><i
                                                                class="fa fa-twitter fa-lg"
                                                                title="Twitter"></i></a>
                                                <?php endif; ?>

                                                <?php if(strlen($post->author->google_plus_url)>0): ?>
                                                    <a href="<?php echo e($post->author->google_plus_url); ?>" rel="publisher"
                                                       target="_blank"><i title="Google+"
                                                                          class="fa fa-google-plus fa-lg"></i></a>
                                                <?php endif; ?>

                                            </div>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endif; ?>
                        </footer>

                    </article>

                    <?php if(sizeof($related_posts) > 0): ?>
                        <div class="related-posts clearfix">
                            <h3 class="block-title"><span>Related Posts</span></h3>

                            <div class="row">
                                <?php foreach($related_posts as $post): ?>
                                    <div class="col-md-6">
                                        <article class="news-block small-block">
                                            <a href="/<?php echo e($post->slug); ?>" class="overlay-link">
                                                <?php if($post->render_type == \App\Posts::RENDER_TYPE_IMAGE): ?>
                                                    <figure class="image-overlay">
                                                        <img src="<?php echo e($post->featured_image); ?>" alt="">
                                                    </figure>
                                                <?php else: ?>
                                                    <?php echo e($post->video_embed_code); ?>

                                                <?php endif; ?>
                                            </a>
                                            <a href="/category/<?php echo e($post->category->slug); ?>/<?php echo e($post->sub_category->slug); ?>"
                                               class="category">
                                                <?php echo e($post->sub_category->title); ?>

                                            </a>
                                            <header class="news-details">
                                                <h3 class="news-title">
                                                    <a href="/<?php echo e($post->slug); ?>">
                                                        <?php echo e($post->title); ?>

                                                    </a>
                                                </h3>

                                                <p class="simple-share">
                                                    by
                                                    <a href="/author/<?php echo e($post->author->slug); ?>"><b><?php echo e($post->author->name); ?></b></a>
                                                    -
                                                <span class="article-date"><i
                                                            class="fa fa-clock-o"></i> <?php echo e($post->created_at->diffForHumans()); ?></span>
                                                </p>
                                            </header>
                                        </article>
                                    </div>
                                <?php endforeach; ?>
                            </div>

                        </div>
                    <?php endif; ?>

                    <?php if(!empty($ads[\App\Ads::TYPE_BELOW_POST])): ?>
                        <div class="row">
                            <div class="col-md-12">
                                <?php echo $ads[\App\Ads::TYPE_BELOW_POST]->code; ?>

                            </div>
                        </div>
                    <?php endif; ?>

                    <?php if($settings_comments->comment_system == \App\Posts::COMMENT_DISQUS): ?>
                        <div id="comments" class="comments-wrapper clearfix">
                            <h3 class="block-title"><span>Comments</span></h3>

                            <?php echo $settings_comments->disqus_js; ?>


                        </div>
                    <?php endif; ?>

                    <?php if($settings_comments->comment_system == \App\Posts::COMMENT_FACEBOOK): ?>
                        <div id="comments" class="comments-wrapper clearfix">
                            <h3 class="block-title"><span>Comments</span></h3>

                            <div class="fb-comments" data-href="<?php echo e(URL::full()); ?>"
                                 data-numposts="<?php echo e(empty($settings_comments->fb_num_posts)?5:$settings_comments->fb_num_posts); ?>"></div>

                        </div>
                    <?php endif; ?>


                </div>

                <div class="col-md-4">
                    <?php echo $__env->make('layouts.sidebar', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                </div>
            </div>

        </div>
    </div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>